﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using BudgetApp.Adapters;
using BudgetApp.Data;

namespace BudgetApp.Controllers
{
    public class StatsController : Controller
    {
        private ApplicationDbContext db = new ApplicationDbContext();
        private IBudgetAdapter _budgetAdapter;

        public StatsController()
        {
            _budgetAdapter = BudgetAdapterFactory.GetBudgetAdapter();
        }

        public StatsController(IBudgetAdapter budgetAdapter)
        {
            _budgetAdapter = budgetAdapter;
        }

        // GET: Stats
        public ActionResult Index()
        {
            List<object> model = new List<object>();

            Dictionary<string, int> DonutChart = _budgetAdapter.IncomeTotals();
            model.Add(DonutChart);
            return View(model);
        }

    }
}